<?php if ($action == ''): ?>
	    <table width="100%" border="0" cellpadding="5">
	      <tr>
	        <td height="243" valign="top" bgcolor="#FFFFFF">
            <table width="100%" border="0" cellspacing="3">
	          <tr>
	            <td height="338" align="center" valign="top" bgcolor="#f7f7f7"><table width="98%" border="0" cellspacing="3" cellpadding="0">
	              <tr>
	                <td width="100%" height="22" align="left" valign="middle" bgcolor="#f7f7f7">
	               		<table width="100%">
	               			<tr ><td> <strong>Current {page}</strong></td>
	               			<td align="right"><strong><a href="{url}/{page}/create"></>Create New {caption}</a></strong></td></tr>
	              	    </table>
	                </td>
                  </tr>
	              <tr>
	                <td height="305" align="left" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="3">
	                  <tr>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Created On</td>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Created By</td>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Updated On</td>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Updated By</td>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Code</td>
	                    <td align="center" valign="middle" bgcolor="#efeeee">Name</td>
	                    <td height="28" align="center" valign="middle" bgcolor="#efeeee">Action</td>
                      </tr>
                    </table>
	                  <table width="100%" border="0" cellspacing="o" cellpadding="o" style="border-bottom:1px solid#CCC;">
	                   <?php if (isset($teamList)): ?>
	                   <!-- ALTERNATIVE FOR FOREACH -->
	                   {logList}
	                    <tr>
	                      <td width="15%" height="33" align="center">{createdon}</td>
	                      <td width="20%" align="center">{createdby}</td>
	                      <td width="15%" align="center">{updatedon}</td>
	                      <td width="16%" align="center">{updatedby}</td>
	                      <td width="18%" align="center">{code}</td>
	                      <td width="16%" align="center">{name}</td>
	                       <td width="16%" align="center"><a href="{url}/{page}/edit/{id}">Edit</a> | <a href="{url}/{page}/delete/{id}">Delete</a></td>
                        </tr>
                        {/logList}
						<?php endif; ?> 
                    	</table>
                    </td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
	      </table>
	      
	
<?php elseif($action == 'add' || $action == 'edit' ): ?>   

 	

	    <table width="100%" border="0" cellpadding="5">
          <tr>
                <td width="100%" height="22" align="left" valign="middle" bgcolor="#f7f7f7">
	               <table width="100%">
	               <tr ><td> <strong>Add new {caption}</strong></td>
	               <td align="right"></td></tr>
                  </table>
               </td>
          </tr>
          
         
	      <tr>
	        <td height="722" valign="top" bgcolor="#FFFFFF">
	        <form action="{url}/{page}/save" method="post">
	        <?php if(isset($id)):?>
	        	<input type="hidden" name="id" value="<?=(isset($id)?$id:'');?>">
	        <?php endif;?>
		    
	        
            <table width="100%" border="0" cellspacing="3">
	          <tr>
	            <td height="652" align="center" valign="top" bgcolor="#f7f7f7"><table width="98%" border="0" cellspacing="3" cellpadding="0">
	              <tr>
	                <td width="19%" align="left" valign="middle">Name</td>
	                <td width="30%" valign="middle"><input name="name" value="<?=(isset($name)?$name:'');?>" type="text" id="textfield" size="30" /></td>
	                <td width="4%" valign="middle">&nbsp;</td>
	                <td width="18%" align="left" valign="middle">Code</td>
	                <td width="29%" height="22" align="left" valign="middle"><input name="code" value="<?=(isset($code)?$code:'');?>" type="text" id="textfield2" size="30" /></td>
                  </tr>
				  
            </table>
              <table width="98%" border="0" cellspacing="3" cellpadding="o">
	                <tr>
	                  <td height="16" valign="top">Description</td>
                    </tr>
	                <tr>
	                  <td height="129" valign="top"><label for="textarea"></label>
                      <textarea name="description" id="textarea"  cols="80" rows="8"><?=(isset($description)?$description:'');?></textarea></td>
                    </tr>
                   
                 </table>
                  <table width="98%" border="0" cellspacing="3" cellpadding="o">
                  <tr>
		            <td colspan="" align="left" valign="middle">&nbsp;</td>
		                  <td valign="middle">&nbsp;</td>
		                  <td height="22" colspan="2" align="right" valign="middle"><input name="button2" type="submit" class="btnSubmit" id="button2" value="Save" /></td>
		          </tr>
                </table>
           	 </form>
            </td>
          </tr>
          
	    </table>
	  
<?php endif; ?> 